import { createRouter, createWebHashHistory } from 'vue-router';
/* 页面中没有挂载路由 */
export default createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/paint',
      name: '/paint',
      component: () => import('@/views/board/core-canvas/layout/ContainerVue.vue'),
    },
    {
      path: '/login',
      name: '/login',
      meta: { title: 'Login' },
      component: () => import('@/views/admin/layout/login/login.vue'),
    },
    {
      path: '/index',
      name: 'index',
      meta: { title: 'Layout' },
      component: () => import('@/views/admin/layout/content/LayoutContent.vue'),
      redirect: {
        name: 'welcome',
      },
      children: [
        {
          path: 'welcome',
          name: 'welcome',
          meta: { title: 'index' },
          component: () => import('@/views/admin/layout/welcome/welcome.vue'),
        },
        {
          path: 'user-center',
          name: 'user-center',
          meta: { title: 'User' },
          component: () => import('@/views/admin/modules/user-center/user-center.vue'),
        },
      ],
    },
    {
      path: '/:pathMatch(.*)*',
      name: '404',
      meta: { title: '404' },
      component: () => import('@/views/admin/layout/404/404.vue'),
    },
  ],
});
